<div class="layui-body">
	<div class="aright">
	<div class="arz cl"><a href="{:url('man/zb/add')}"><i class="layui-icon">&#xe608;</i>添加内容</a></div>
	<form method="post" class="aform cl" >
	<table width="100%">
	      <tr>

			<th width="5%" align="center">ID编号</th>
	        <th width="5%" align="center">视频标题</th>
	        <th width="10%" align="center">视频vid</th>
	        <th width="15%" align="center">描述</th>
			<th width="15%" align="center">缩略图</th>
	       	<!--   <th width="5%" align="center">是否热门</th>
			<th width="5%" align="center">是否置顶</th>
			<th width="7%" align="center">显示在更多</th>-->
			<th width="5%" align="center">显示人数</th>
			<th width="10%" align="center">是否显示</th>
			<th width="5%" align="center">排序</th>
			<th width="5%" align="center">选项</th>
			<th width="6%" align="center">模板</th>
	        <th width="12%" align="center">基本操作</th>
	      </tr>
	      {volist name="list" id="vo"}
		  <tr>
			<td align="center">{$vo.id}</td>
			<td align="center">{$vo.name}</td>
			<td align="center">{$vo.title}</td>
	        <td align="center">{$vo.desc|msubstr=0,30,'utf8',true}</td>
			<td align="center">
			{if condition="$vo['pic'] neq ''"}
	        <img src="{$vo.pic}" height="35">
	        {else /}
	        暂无缩略图
	        {/if}
			</td>
			<td align="center">{$vo.number}</td>
			{if condition="$vo['display'] eq '1' "}
			<td align="center"><span style="color:#FF5722;cursor: pointer;" onclick="upField({$vo.id},'display',2)">显示</span></td>
			{else /}
			<td align="center"><span style="cursor: pointer;" onclick="upField({$vo.id},'display',1)">隐藏</span></td>
			{/if}
			<td align="center">{$vo.paixu}</td>
			<td align="center">{$vo.index}</td>
			<td align="center">{$vo.template}</td>
	        <td align="center"><a href="{:url('man/zb/edit',['id'=>$vo['id']])}">【编 辑】</a> | <a onclick="deleted({$vo.id});">【删 除】</a>
	        </td>
	      </tr>
	      {/volist}
	 </table>
	  </form>
	 		<div class="pages">
 				{$list->render()}
	 	 	</div>
	</div>
	</div>
</div>
<script>
layui.use('layer',function(){
	var layer = layui.layer;
})
function deleted(aid){
	$.post("{:url('man/zb/delete')}",{'aid':aid},function(data){
		if(data){
			layer.msg("删除成功");
			setTimeout(function(){
				window.location.reload();
			},1000);
			
		}
	})
}

function upField(aid,field,val){
	$.post("{:url('man/zb/upField')}",{'aid':aid,'field':field,'val':val},function(data){
		if(data){
			layer.msg("更新成功");
			setTimeout(function(){
				window.location.reload();
			},500);
		}else{
			layer.msg("更新失败");
			setTimeout(function(){
				window.location.reload();
			},1000);
		}
	})
}
</script>